package com.nq.api.recharge;


import com.nq.common.ServerResponse;
import com.nq.recharge.service.IStRechargeCardService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

@Controller
@RequestMapping({"/user/recharge/"})
@Slf4j
public class RechargeCardController {


    @Resource
    private IStRechargeCardService cardService;

    /**
     * 充值卡列表接口
     * @param httpServletRequest
     * @return
     */
    @RequestMapping(value = {"cardList.do"}, method = {RequestMethod.POST})
    @ResponseBody
    public ServerResponse cardList(HttpServletRequest httpServletRequest) {
        return this.cardService.cardList(httpServletRequest);
    }


    /**
     * 查询充值卡接口
     * @param httpServletRequest
     * @return
     */
    @RequestMapping(value = {"queryCard.do"}, method = {RequestMethod.POST})
    @ResponseBody
    public ServerResponse queryCard(@RequestParam("password") String password, HttpServletRequest httpServletRequest) {
        return this.cardService.queryCard(password, httpServletRequest);
    }

}
